The present invention relates to controlling the execution of a program in an information processor for processing instructions by pipelining.
In an information processor such as microprocessor or digital signal processor (DSP) for executing instructions by pipeline processing, a pipeline hazard resulting from conditional branching, i.e., a branch hazard, will happen. Particularly when there is a great number of pipeline stages, the branch hazard causes a serious problem.
To minimize the issuance of conditional branch instructions, conditionally executable instructions are adoptable effectively. For example, according to the technique disclosed in Japanese Laid-Open Publication No. 10-49368, each conditionally executable instruction contains a condition field specifying its own execution condition. That is to say, the instruction is selectively executed depending on whether or not the execution condition specified by its own condition field is satisfied. This technique is hard to apply to an information processor of the type using a short instruction word length, because each instruction to be executed by the processor cannot afford including such an additional condition field.
As for the short-word-length information processor, an instruction issued exclusively to control the conditional execution of succeeding instructions, i.e., an execution control instruction, is applicable effectively. For instance, according to the technique disclosed in Japanese Laid-Open Publication No. 7-253882, the execution control instruction contains a condition field specifying multiple registers. The number of registers specified in the condition field is always equal to the number of instructions, which succeed the execution control instruction and will be executed under controlled conditions, and is a fixed number. And it is determined based on the value of each of these registers whether or not a succeeding instruction corresponding to the register should be executed. As a result, conditional branch instructions do not have to be used so frequently.
According to the technique disclosed in the latter publication, however, if the number of instructions to be executed under controlled conditions should be increased, then the number of registers specified in the condition field of the execution control instruction has to be increased. As a result, the length of each instruction word must be increased unintentionally. Thus, the short-word-length information processor cannot control the conditional execution of so many succeeding instructions using the execution control instruction.